<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
  <title></title>
  <script>
    let count = 0;
    let pricePerItem = 4.99;





    function increaseCount() {
      count++;
      document.getElementById("countDisplay").innerHTML = count;
      calculatePrice();
    }

    function calculatePrice() {
      let totalPrice = count * pricePerItem;
      document.getElementById("totalPriceDisplay").innerHTML = totalPrice;
    }
  </script>
  </head>


<body>

<button onclick="increaseCount()">点击我</button>
<p>商品数量：<span id="countDisplay">0</span></p>
<p>总价：<span id="totalPriceDisplay">0</span> 元</p>
</body>

</html>



